<template>
  <div>
    <!--操作记录 -->
    <el-dialog
      width="60%"
      v-model="viewDetails"
      title="操作记录"
      top="20vh"
      class="el-overlay1"
      @close="handleclose"
    >
      <el-table
        :data="ruleDetailList"
        border
        class="table"
        ref="multipleTable"
        header-cell-class-name="table-header"
      >
        <el-table-column prop="operateStatus" label="操作项">
          <template #default="scope">
            {{
              scope.row.operateStatus == 1
                ? "通过"
                : scope.row.operateStatus == 0
                ? "受理"
                : "拒绝"
            }}
          </template>
        </el-table-column>
        <el-table-column prop="operateUserName" label="操作人"></el-table-column>
        <el-table-column prop="operateTime" label="操作时间"></el-table-column>
        <el-table-column v-if="is_realname == 1" prop="reason" label="描述">
          <template #default="scope">
            <div v-if="scope.row.CauseContent">
              {{ scope.row.CauseContent }}<span v-if="scope.row.CauseContent">,</span>
              {{ scope.row.AuditContent }}
            </div>
            <div v-if="scope.row.reason">
              {{ scope.row.reason }}<span v-if="scope.row.remark">,</span>
              {{ scope.row.remark }}
            </div>
          </template>
        </el-table-column>
        <el-table-column v-else prop="reason" label="描述">
          <template #default="scope">
            <div v-if="scope.row.reason">
              {{ scope.row.reason }}<span v-if="scope.row.remark">,</span>
              {{ scope.row.remark }}
            </div>
          </template>
        </el-table-column>
      </el-table>
    </el-dialog>
  </div>
</template>
<script>
import { ElMessage } from "element-plus";
import { ref, reactive } from "vue";
export default {
  setup(props, context) {
    console.log(context);
    console.log(context.attrs.ruleDetailList);
    const is_realname = context.attrs.type;
    const ruleDetailList = context.attrs.ruleDetailList;
    const viewDetails = ref(true);
    const handleclose = () => {
      viewDetails.value = false;
      context.emit("handleclose", viewDetails.value);
    };
    return {
      viewDetails: true,
      ruleDetailList,
      is_realname,
      handleclose,
    };
  },
};
</script>
<style scoped></style>
